package com.ufgov.agcfs.report.entity;

import java.io.Serializable;

public class RptTypeNode implements Serializable{
	private static final long serialVersionUID = 807714332969702595L;
	/*
	 	一次性加载的时候不能加children属性
		分级加载的时候才能加
		id,parent,text为必须字段，其他可以根据情况自己加
	*/
	private String id;	
	private String parent;	
	private String text;
//	private boolean children;
	private String nd;
	private String code;
	private String type;
	
	public RptTypeNode(){
	}
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
//	public boolean isChildren() {
//		return children;
//	}
//	public void setChildren(boolean children) {
//		this.children = children;
//	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	
	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		RptTypeNode castOther = (RptTypeNode)other;
		return 
			this.id.equals(castOther.id);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.id.hashCode();
		return hash;
	}

	public String getParent() {
		return parent;
	}

	public void setParent(String parent) {
		this.parent = parent;
	}
	
	/**
	 * 
	 * @param id
	 * @param nd
	 * @param code
	 * @param text
	 * @param children
	 * @param parent
	 * @param type
	 * @return RptTypeNode
	 */
	public static RptTypeNode createNode(String id,String nd,String code,
										String text,boolean children,
										String parent,String type){		
		RptTypeNode node = new RptTypeNode();
		node.setId(id);
		node.setNd(nd);
		node.setCode(code);
		node.setText(text);
		node.setParent(parent);
//		node.setChildren(children);
		node.setType(type);
		return node;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getNd() {
		return nd;
	}

	public void setNd(String nd) {
		this.nd = nd;
	}

}
